// 目前引用该js首先必须引入jQuery.js
var processPageStaticVo = new Object();

$(document).ready(function() {
	var len = document.forms.length;
	for ( var i = 0; i < len; i++) {
		var form = document.forms[i];
		var onSubmitItem = document.createAttribute("onsubmit");
		onSubmitItem.value = "processPageStatic()";
		form.attributes.setNamedItem(onSubmitItem);
	}
});

function processPageStatic() {

	if ($(":submit") != null) {
		$(":submit").remove();
	}
	if ($(":button") != null) {
		$(":button").remove();
	}
	if ($(":reset") != null) {
		$(":reset").remove();
	}
	var html = ("<HTML>" + document.documentElement.innerHTML + "</HTML>");
	var taskInstanceId = document
			.getElementById("processInformation.taskInstanceId");
	var taskInstanceIdValue;
	if (taskInstanceId == null) {
		taskInstanceIdValue = new Date().toLocaleTimeString();
	} else {
		taskInstanceIdValue = taskInstanceId.value;
	}
	processPageStaticVo.taskInstanceId = taskInstanceIdValue;
	processPageStaticVo.processInstanceId = "processInstancdId_test";
	processPageStaticVo.html = html;
	var pageStaticVoJson = $.toJSON(processPageStaticVo);

	var p_pageStaticVo = encodeURIComponent(pageStaticVoJson);
	aJax_(p_pageStaticVo);
}

function aJax_(p_pageStaticVo) {
	$.ajax( {
		type : "post",
		html : "html",
		url : "pageStaticAction!pageStaticAjax.action",
		beforeSend : function(XMLHttpRequest) {
			// alert("before " + p_pageStaticVo);
	},
	data : "pageStaticJSON=" + p_pageStaticVo,
	success : function(data, textStatus) {
		if (data == "sucess") {
		}
	},
	complete : function(XMLHttpRequest, textStatus) {
	},
	error : function() {
	}
	});
}
